import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";

// vue3 component 必须使用懒加载， 不能直接使用 import 导入， 不然vue-router会报 非法组件
const routes: RouteRecordRaw[] = [
  {
    path: "/",
    name: "home",
    component: () => import('@/views/home/index.vue')
  },
  {
    path: "/about",
    name: "about",
    component: () => import('@/views/about/index.vue')
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router